﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace ControllerClient
{
    class FileWriter
    {
        public static void writeTxt(string filename, string str)
        {
        //    string filename = "Write.txt";
            if (File.Exists(filename) == false)
            {
                StreamWriter sw = File.CreateText(filename);
                sw.Write(str);
                sw.Close();
            }
            else
            {
                using (StreamWriter sw = new StreamWriter(filename, false))
                {
                    sw.WriteLine(str);
                    sw.Close();
                }
            }

        }
    }

   
}
